home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 75 / XENIATGM75.iso / Shareware / X-Setup 5.0 / _SETUP.1 / XQ DOC ShellEx.xpl < prev    next >
Text File  |  1999-06-26  |  2KB  |  82 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 5.0"
  2. "TYPE"="1"
  3. "COUNT"="4"
  4. "UIPATH"="Appearance\Explorer\Files"
  5. "NAME"="*.DOC Commands"
  6. "VERSION"="1.0"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="(1) Name"
  9. "TEXT 2"="(1) Command"
  10. "TEXT 3"="(2) Name"
  11. "TEXT 4"="(2) Command"
  12. "DESCRIPTION 1"="The extension DOC (*.DOC) is used by many programs such as Microsoft Word and WordPad and others as well."
  13. "DESCRIPTION 2"="This plug-in will allow you to specify which program(s) you wish to use when opening files with the .DOC extension."
  14. "DESCRIPTION 3"="To remove the command(s), clear both the "Name" and the "Command" field and press "Apply"."
  15. "AUTHOR"="Xteq Systems"
  16. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  17. "COMMENT 1"="For more information, go to http://www.xteq.com or write to TeXHeX@xteq.com."
  18.  
  19.  
  20. sPathBase="HKCR\.doc\@"
  21.  
  22. sPath1="" 'set later through code
  23. sPath2="" 'dito 
  24.  
  25. sCMD="Command\@" '*** this is always the same
  26.  
  27. Sub Plugin_Initialize
  28.  ' First check where this stuff goes to
  29.  s=RegReadValue(sPathBase)
  30.  if IsEmpty(s)=true then
  31.     'nothing found - we'll stick with .DOC
  32.     s=".doc"
  33.  end if
  34.  sPath1="HKCR\" & s & "\Shell\XQXSETCMD1\"
  35.  sPath2="HKCR\" & s & "\Shell\XQXSETCMD2\"
  36.  
  37.  
  38.  Call ReadStuff(sPath1,1)
  39.  Call ReadStuff(sPath2,3)
  40. End Sub
  41.  
  42. Sub ReadStuff(Path,UIStart)
  43.  s=RegReadValue(Path & sCMD)
  44.  if len(s)>0 then
  45.     s=RegReadValue(Path & "@")
  46.     SetUIElement UIStart,s
  47.  
  48.     s=RegReadValue(Path & sCMD)
  49.     SetUIElement UIStart+1,s
  50.  end if
  51.  
  52. end sub
  53.  
  54.  
  55. Sub Plugin_CheckData(ElementIndex)
  56. End Sub
  57.  
  58. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  59.  Call WriteStuff(sPath1,1)
  60.  Call WriteStuff(sPath2,3)
  61. End Sub
  62.  
  63. Sub WriteStuff(Path,UIStart)
  64.  s1=GetUIElement(UIStart)
  65.  s2=GetUIElement(UIStart+1)
  66.  
  67.  
  68.  if len(s1)>0 or len(s2)>0 then
  69.     Call RegWriteValue(Path & sCMD,s2,1)
  70.     Call RegWriteValue(Path & "@",s1,1)
  71.  else
  72.   if IsEmpty(RegReadValue(Path & sCMD))=false then
  73.      Call RegDeletePath(Path & "Command")
  74.      Call RegDeletePath(Path)
  75.   end if
  76.  end if
  77.  
  78. End Sub
  79.  
  80. Sub Plugin_Terminate 
  81. End Sub
  82.